<?php
namespace app\crm\model;

use app\admin\model\ShopModel;
use app\mini\model\CustomerPointModel;
use app\shop\model\Goods;
use think\facade\Db;
use app\admin\model\Common;

class ServiceOrderSendLog extends Common
{

    /**
     * 为了数据库的整洁，同时又不影响Model和Controller的名称
     * 我们约定每个模块的数据表都加上相同的前缀，比如CRM模块用crm作为数据表前缀
     */
    protected $name = 'service_order_send_log';

    public function shop(){
        return $this->hasOne(ShopModel::class,'shop_id','shop_id');
    }

    public function customer(){
        return $this->hasOne(Customer::class,'id','customer_id');
    }

    public function nuserone(){
        return $this->hasOne(ShopPerson::class,'id','nurse_id_one');
    }

    public function nursetwo(){
        return $this->hasOne(ShopPerson::class,'id','nurse_id_two');
    }

    public function goods(){
        return $this->hasOne(Goods::class,'id','goods_id');
    }


}

